<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <script type="text/javascript">
        	function whichradio(){
				var radiovalue="";
				for(var i=0;i<document.myForm.group1.length;i++){
					if(document.myForm.group1[i].checked){
						radiovalue=document.myForm.group1[i].value;
					}
				}
				return radiovalue;
			}
			function selectradio(index){
				document.myForm.group1[index].checked=true;
			}
        </script>
    </head>
    <body>
    	<form action="" name="myForm">
    		<input type="radio" name="group1" value="1" onclick="alert('yes');" checked/>yes
			<input type="radio" name="group1" value="0" onclick="alert('no');"/>no
			<br><a href="#" onclick="selectradio(0);">yes</a>&nbsp;<a href="#" onclick="selectradio(1);">no</a>
			<br><a href="#" onclick="alert(whichradio());">whichradio</a>
			<br>
			<input type="radio" name="group2" value="yes"/>yes
			<input type="radio" name="group2" value="no"/>no
    	</form>
    </body>
</html>
